2006-09-16 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfilechooserbutton.c: Use bookmark labels in
+ the combobox.
+
* gtk/gtkfilechooserbutton.c: Don't add remote volumes and
bookmarks to the model in local-only mode, to avoid
authentication dialogs pop up for invisible bookmarks, and
struct SetDisplayNameData
{
GtkFileChooserButton *button;
+ char *label;
GtkTreeRowReference *row_ref;
};
pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (data->button),
data->button->priv->icon_size, NULL);
+ if (!data->label)
+ data->label = g_strdup (gtk_file_info_get_display_name (info));
+
gtk_list_store_set (GTK_LIST_STORE (data->button->priv->model), &iter,
ICON_COLUMN, pixbuf,
- DISPLAY_NAME_COLUMN, gtk_file_info_get_display_name (info),
+ DISPLAY_NAME_COLUMN, data->label,
IS_FOLDER_COLUMN, gtk_file_info_get_is_folder (info),
-1);
out:
g_object_unref (data->button);
+ g_free (data->label);
gtk_tree_row_reference_free (data->row_ref);
g_free (data);
data = g_new0 (struct SetDisplayNameData, 1);
data->button = g_object_ref (button);
+ data->label = gtk_file_system_get_bookmark_label (button->priv->fs, path);
+
tree_path = gtk_tree_model_get_path (button->priv->model, iter);
data->row_ref = gtk_tree_row_reference_new (button->priv->model, tree_path);
gtk_tree_path_free (tree_path);